﻿' LibWowArmory
' by Ronald M. Clifford (roncli@roncli.com)
'
' This source code is released under the GNU Library General Public License (LGPL) Version 2.1.

Imports System
Imports System.Collections.Generic
Imports System.Collections.Specialized
Imports System.IO
Imports System.Linq
Imports System.Web
Imports System.Xml.Serialization

Namespace roncliProductions.LibWowArmory

    ''' <summary>
    ''' A class to get information on an item from the Armory
    ''' </summary>
    ''' <remarks></remarks>
    Public Class ItemInfo
        Inherits WowArmoryData

#Region "Declarations"

        Private iiPage As New ItemInfoSchema.page
        Private intID As Integer

#End Region

#Region "Properties"

        ''' <summary>
        ''' The ID number of the item you wish to retrieve from the Armory
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property ID() As Integer
            Get
                Return intID
            End Get
            Set(ByVal value As Integer)
                intID = value
            End Set
        End Property

        ''' <summary>
        ''' The URL that will be used to retrieve the item from the Armory
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Overrides ReadOnly Property URL() As String
            Get
                Return String.Format("http://www.wowarmory.com/item-info.xml?i={0}", intID)
            End Get
        End Property

        ''' <summary>
        ''' Indicates to the inherited class that this request does not require login
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Overrides ReadOnly Property RequiresLogin() As Boolean
            Get
                Return False
            End Get
        End Property

        ''' <summary>
        ''' The costs associated with the item
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property Cost() As ItemCost
            Get
                Dim iItem As ItemInfoSchema.itemInfo_item = GetItem().First()
                If iItem.cost.Count() = 0 Then
                    Return Nothing
                Else
                    Return (From c In iItem.cost Select New ItemCost(GetTokens(c), c.arena, c.buyPrice, c.factionId, c.honor, c.sellPrice)).First()
                End If
            End Get
        End Property

        ''' <summary>
        ''' The random properties of the item
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property RandomProperties() As List(Of RandomProperty)
            Get
                Dim rpProperties As ItemInfoSchema.randomProperties = GetRandomProperties()
                If rpProperties Is Nothing Then
                    Return New List(Of RandomProperty)
                Else
                    Return (From p In rpProperties.randomProperty Select New RandomProperty(p.suffix, GetRandomPropertyEnchants(p))).ToList()
                End If
            End Get
        End Property

        ''' <summary>
        ''' The skill rank required to disenchant the item
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property DisenchantLootSkillRank() As Integer
            Get
                Dim dlDisenchantLoot As ItemInfoSchema.disenchantLoot = GetDisenchantLoot()
                If dlDisenchantLoot Is Nothing Then
                    Return 0
                Else
                    Return dlDisenchantLoot.requiredSkillRank
                End If
            End Get
        End Property

        ''' <summary>
        ''' The items that the item can be disenchanted into
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property DisenchantLoot() As List(Of DisenchantItem)
            Get
                Dim dlDisenchantLoot As ItemInfoSchema.disenchantLoot = GetDisenchantLoot()
                If dlDisenchantLoot Is Nothing Then
                    Return New List(Of DisenchantItem)
                Else
                    Dim strKey As String = String.Format("LibWowArmory.ItemInfo.{0}.DisenchantLoot", intID)
                    If Cache.Cache(strKey) Is Nothing Then
                        Dim lstDisenchantItems As List(Of DisenchantItem) = (From i In dlDisenchantLoot.item Select New DisenchantItem(i.dropRate, i.icon, i.id, i.level, i.maxCount, i.minCount, i.name, i.quality, i.type)).ToList()

                        Cache.Cache.Insert(strKey, lstDisenchantItems, Nothing, Date.UtcNow.AddDays(1), Nothing, Caching.CacheItemPriority.Normal, Nothing)

                        Return lstDisenchantItems
                    Else
                        Return CType(Cache.Cache(strKey), List(Of DisenchantItem))
                    End If
                End If
            End Get
        End Property

        ''' <summary>
        ''' The quest that the item starts
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property StartsQuest() As Quest
            Get
                Dim sqQuest As ItemInfoSchema.startsQuest = GetStartsQuest()
                If sqQuest Is Nothing Then
                    Return Nothing
                Else
                    Return (From q In sqQuest.quest Select New Quest(q.area, q.id, q.level, q.name, q.reqMinLevel, q.suggestedPartySize, q.type)).First()
                End If
            End Get
        End Property

        ''' <summary>
        ''' The quests that the item is provided for
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property ProvidedForQuests() As List(Of Quest)
            Get
                Dim pfqQuests As ItemInfoSchema.providedForQuests = GetProvidedForQuests()
                If pfqQuests Is Nothing Then
                    Return New List(Of Quest)
                Else
                    Return (From q In pfqQuests.quest Select New Quest(q.area, q.id, q.level, q.name, q.reqMinLevel, q.suggestedPartySize, q.type)).ToList()
                End If
            End Get
        End Property

        ''' <summary>
        ''' The quests that the item is an objective of
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property ObjectiveOfQuests() As List(Of Quest)
            Get
                Dim ooQuests As ItemInfoSchema.objectiveOfQuests = GetObjectiveOfQuests()
                If ooQuests Is Nothing Then
                    Return New List(Of Quest)
                Else
                    Return (From q In ooQuests.quest Select New Quest(q.area, q.id, q.level, q.name, q.reqMinLevel, q.suggestedPartySize, q.type)).ToList()
                End If
            End Get
        End Property

        ''' <summary>
        ''' The quests that the item is a reward from
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property RewardFromQuests() As List(Of Quest)
            Get
                Dim rfqQuests As ItemInfoSchema.rewardFromQuests = GetRewardFromQuests()
                If rfqQuests Is Nothing Then
                    Return New List(Of Quest)
                Else
                    Return (From q In rfqQuests.quest Select New Quest(q.area, q.id, q.level, q.name, q.reqMinLevel, q.suggestedPartySize, q.type)).ToList()
                End If
            End Get
        End Property

        ''' <summary>
        ''' The vendors that the item can be bought from
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property Vendors() As List(Of Creature)
            Get
                Dim vVendors As ItemInfoSchema.vendors = GetVendors()
                If vVendors Is Nothing Then
                    Return New List(Of Creature)
                Else
                    Return (From v In vVendors.creature Select New Creature(v.area, v.areaUrl, v.classification, v.dropRate, v.heroic, v.id, v.maxLevel, v.minLevel, v.name, v.title, v.type, v.url)).ToList()
                End If
            End Get
        End Property

        ''' <summary>
        ''' The objects that the item can be found in
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property ContainerObjects() As List(Of [Object])
            Get
                Dim coObjects As ItemInfoSchema.containerObjects = GetContainerObjects()
                If coObjects Is Nothing Then
                    Return New List(Of [Object])
                Else
                    Return (From o In coObjects.object Select New [Object](o.area, o.areaUrl, o.dropRate, o.heroic, o.id, o.name, o.url)).ToList()
                End If
            End Get
        End Property

        ''' <summary>
        ''' The specific creatures the item drops from
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property DropSpecificCreatures() As List(Of Creature)
            Get
                Dim dcDropCreatures As ItemInfoSchema.dropCreatures = GetDropCreatures()
                If dcDropCreatures Is Nothing Then
                    Return New List(Of Creature)
                Else
                    Return (From c In dcDropCreatures.creature Select New Creature(c.area, c.areaUrl, c.classification, c.dropRate, c.heroic, c.id, c.maxLevel, c.minLevel, c.name, c.title, c.type, c.url)).ToList()
                End If
            End Get
        End Property

        ''' <summary>
        ''' A general description of creatures the item drops from
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property DropGeneralCreatures() As CreatureInfo
            Get
                Dim dcDropCreatures As ItemInfoSchema.dropCreatures = GetDropCreatures()
                If dcDropCreatures Is Nothing Then
                    Return Nothing
                ElseIf dcDropCreatures.info.Count = 0 Then
                    Return Nothing
                Else
                    Return (From i In dcDropCreatures.info Select New CreatureInfo(GetAreaInfo(i), GetCreatureTypes(i), i.avgMaxLevel, i.avgMinLevel, i.maxLevel, i.minLevel)).First()
                End If
            End Get
        End Property

        ''' <summary>
        ''' The specific creatures the item is pick pocketed from
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property PickPocketSpecificCreatures() As List(Of Creature)
            Get
                Dim ppcPickPocketCreatures As ItemInfoSchema.pickPocketCreatures = GetPickPocketCreatures()
                If ppcPickPocketCreatures Is Nothing Then
                    Return New List(Of Creature)
                Else
                    Return (From c In ppcPickPocketCreatures.creature Select New Creature(c.area, c.areaUrl, c.classification, c.dropRate, c.heroic, c.id, c.maxLevel, c.minLevel, c.name, c.title, c.type, c.url)).ToList()
                End If
            End Get
        End Property

        ''' <summary>
        ''' A general description of creatures the item is pick pocketed from
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property PickPocketGeneralCreatures() As CreatureInfo
            Get
                Dim ppcPickPocketCreatures As ItemInfoSchema.pickPocketCreatures = GetPickPocketCreatures()
                If ppcPickPocketCreatures Is Nothing Then
                    Return Nothing
                ElseIf ppcPickPocketCreatures.info.Count = 0 Then
                    Return Nothing
                Else
                    Return (From i In ppcPickPocketCreatures.info Select New CreatureInfo(GetAreaInfo(i), GetCreatureTypes(i), i.avgMaxLevel, i.avgMinLevel, i.maxLevel, i.minLevel)).First()
                End If
            End Get
        End Property

        ''' <summary>
        ''' The specific creatures the item is skinned from, via skinning or engineering
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property SkinSpecificCreatures() As List(Of Creature)
            Get
                Dim scSkinCreatures As ItemInfoSchema.skinCreatures = GetSkinCreatures()
                If scSkinCreatures Is Nothing Then
                    Return New List(Of Creature)
                Else
                    Return (From c In scSkinCreatures.creature Select New Creature(c.area, c.areaUrl, c.classification, c.dropRate, c.heroic, c.id, c.maxLevel, c.minLevel, c.name, c.title, c.type, c.url)).ToList()
                End If
            End Get
        End Property

        ''' <summary>
        ''' A general description of creatures the item is skinned from, via skinning or engineering
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property SkinGeneralCreatures() As CreatureInfo
            Get
                Dim scSkinCreatures As ItemInfoSchema.skinCreatures = GetSkinCreatures()
                If scSkinCreatures Is Nothing Then
                    Return Nothing
                ElseIf scSkinCreatures.info.Count = 0 Then
                    Return Nothing
                Else
                    Return (From i In scSkinCreatures.info Select New CreatureInfo(GetAreaInfo(i), GetCreatureTypes(i), i.avgMaxLevel, i.avgMinLevel, i.maxLevel, i.minLevel)).First()
                End If
            End Get
        End Property

        ''' <summary>
        ''' The specific creatures the item is herbed from
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property HerbSpecificCreatures() As List(Of Creature)
            Get
                Dim hcHerbCreatures As ItemInfoSchema.herbCreatures = GetHerbCreatures()
                If hcHerbCreatures Is Nothing Then
                    Return New List(Of Creature)
                Else
                    Return (From c In hcHerbCreatures.creature Select New Creature(c.area, c.areaUrl, c.classification, c.dropRate, c.heroic, c.id, c.maxLevel, c.minLevel, c.name, c.title, c.type, c.url)).ToList()
                End If
            End Get
        End Property

        ''' <summary>
        ''' A general description of creatures the item is herbed from
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property HerbGeneralCreatures() As CreatureInfo
            Get
                Dim hcHerbCreatures As ItemInfoSchema.herbCreatures = GetHerbCreatures()
                If hcHerbCreatures Is Nothing Then
                    Return Nothing
                ElseIf hcHerbCreatures.info.Count = 0 Then
                    Return Nothing
                Else
                    Return (From i In hcHerbCreatures.info Select New CreatureInfo(GetAreaInfo(i), GetCreatureTypes(i), i.avgMaxLevel, i.avgMinLevel, i.maxLevel, i.minLevel)).First()
                End If
            End Get
        End Property

        ''' <summary>
        ''' The specific creatures the item is mined from
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property MineSpecificCreatures() As List(Of Creature)
            Get
                Dim mcMineCreatures As ItemInfoSchema.mineCreatures = GetMineCreatures()
                If mcMineCreatures Is Nothing Then
                    Return New List(Of Creature)
                Else
                    Return (From c In mcMineCreatures.creature Select New Creature(c.area, c.areaUrl, c.classification, c.dropRate, c.heroic, c.id, c.maxLevel, c.minLevel, c.name, c.title, c.type, c.url)).ToList()
                End If
            End Get
        End Property

        ''' <summary>
        ''' A general description of creatures the item is mined from
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property MineGeneralCreatures() As CreatureInfo
            Get
                Dim mcMineCreatures As ItemInfoSchema.mineCreatures = GetMineCreatures()
                If mcMineCreatures Is Nothing Then
                    Return Nothing
                ElseIf mcMineCreatures.info.Count = 0 Then
                    Return Nothing
                Else
                    Return (From i In mcMineCreatures.info Select New CreatureInfo(GetAreaInfo(i), GetCreatureTypes(i), i.avgMaxLevel, i.avgMinLevel, i.maxLevel, i.minLevel)).First()
                End If
            End Get
        End Property

        ''' <summary>
        ''' The spell that creates the item
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property CreatedBy() As SpellReagents
            Get
                Dim cbCreatedBy As ItemInfoSchema.createdBy = GetCreatedBy()
                If cbCreatedBy Is Nothing Then
                    Return Nothing
                Else
                    Return (From s In cbCreatedBy.spell Select New SpellReagents(GetCreatedBySpellReagents(s), s.Icon, s.id, s.name)).First()
                End If
            End Get
        End Property

        ''' <summary>
        ''' The spell that the item is a reagent for
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property ReagentFor() As List(Of SpellItem)
            Get
                Dim rfReagentFor As ItemInfoSchema.reagentFor = GetReagentFor()
                If rfReagentFor Is Nothing Then
                    Return New List(Of SpellItem)
                Else
                    Return (From s In rfReagentFor.spell Select New SpellItem(GetSpellItem(s), GetReagentForSpellReagents(s), s.Icon, s.id, s.name)).ToList()
                End If
            End Get
        End Property

        ''' <summary>
        ''' The items that can be bought with this item
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property CurrencyFor() As List(Of CurrencyItem)
            Get
                Dim cfCurrencyFor As ItemInfoSchema.currencyFor = GetCurrencyFor()
                If cfCurrencyFor Is Nothing Then
                    Return New List(Of CurrencyItem)
                Else
                    Return (From i In cfCurrencyFor.item Select New CurrencyItem(GetCurrencyItemCost(i), i.icon, i.id, i.level, i.name, i.quality, i.requiredSkill, i.requiredSkillRank, i.type)).ToList()
                End If
            End Get
        End Property

        ''' <summary>
        ''' The filename of the icon of the item
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property Icon() As String
            Get
                Return GetItem().First().icon
            End Get
        End Property

        ''' <summary>
        ''' The level of the item
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property Level() As Integer
            Get
                Return GetItem().First().level
            End Get
        End Property

        ''' <summary>
        ''' Determines whether or not the item is a quest item that drops for everyone in the party
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property MultiLoot() As Boolean
            Get
                Return GetItem().First().multiLoot = 1
            End Get
        End Property

        ''' <summary>
        ''' Determines whether or not the item is an item that starts a quest and drops for everyone in the party
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property MultiLootQuest() As Boolean
            Get
                Return GetItem().First().multiLootQuest = 1
            End Get
        End Property

        ''' <summary>
        ''' The name of the item
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property Name() As String
            Get
                Return GetItem().First().name
            End Get
        End Property

        ''' <summary>
        ''' The quality of the item
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property Quality() As RarityType
            Get
                Return CType(GetItem().First().quality, RarityType)
            End Get
        End Property

        ''' <summary>
        ''' The required ability to use the item
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property RequiredAbility() As String
            Get
                Return GetItem().First().requiredAbility
            End Get
        End Property

        ''' <summary>
        ''' The required profession to use the item
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property RequiredSkill() As String
            Get
                Return GetItem().First().requiredSkill
            End Get
        End Property

        ''' <summary>
        ''' The required skill level to use the item
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property RequiredSkillRank() As Integer
            Get
                Return GetItem().First().requiredSkillRank
            End Get
        End Property

        ''' <summary>
        ''' The type of the item
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property Type() As String
            Get
                Return GetItem().First().type
            End Get
        End Property

        ''' <summary>
        ''' The faction that can use the item
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks>A return of FactionType.None indicates there are no faction restrictions</remarks>
        Public ReadOnly Property FactionRestriction() As FactionType
            Get
                If GetItem().First().translationFor.Count = 0 Then
                    Return FactionType.None
                Else
                    Select Case GetItem.First().translationFor.First().factionEquiv
                        Case 0
                            Return FactionType.Horde
                        Case 1
                            Return FactionType.Alliance
                    End Select
                End If
            End Get
        End Property

        ''' <summary>
        ''' The items that are equivalent for the other faction to this item
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property TranslationFor() As List(Of TranslationForItem)
            Get
                Dim tfTranslationFor As ItemInfoSchema.translationFor = GetTranslationFor()
                If tfTranslationFor Is Nothing Then
                    Return New List(Of TranslationForItem)
                Else
                    Return (From i In tfTranslationFor.item Select New TranslationForItem(tfTranslationFor.factionEquiv, i.icon, i.id, i.level, i.name, i.quality)).ToList()
                End If
            End Get
        End Property

#End Region

#Region "Public Methods"

        ''' <summary>
        ''' Constructor to load an item with a known ID number
        ''' </summary>
        ''' <param name="intID"></param>
        ''' <remarks></remarks>
        Public Sub New(ByVal intID As Integer)
            Me.intID = intID
            Load()
        End Sub

        ''' <summary>
        ''' Loads the item from the Aarmory
        ''' </summary>
        ''' <remarks></remarks>
        Public Sub Load()
            Dim strKey As String = String.Format("LibWowArmory.ItemInfo.{0}", intID)
            If Cache.Cache(strKey) Is Nothing Then
                MyBase.Retrieve()

                Dim xsSerializer As New XmlSerializer(iiPage.GetType())

                Dim srXML As New StringReader(MyBase.strData)

                iiPage = CType(xsSerializer.Deserialize(srXML), ItemInfoSchema.page)

                Cache.Cache.Insert(strKey, iiPage, Nothing, Date.UtcNow.AddDays(1), Nothing, Caching.CacheItemPriority.Normal, Nothing)
            Else
                iiPage = CType(Cache.Cache(strKey), ItemInfoSchema.page)
            End If

            If iiPage.itemInfo Is Nothing Then
                Throw New ArgumentException("The item you are trying to retrieve does not exist.")
            End If
            If iiPage.itemInfo.First().item Is Nothing Then
                Throw New ArgumentException("The item you are trying to retrieve does not exist.")
            End If
        End Sub

#End Region

#Region "Private Methods"

        ''' <summary>
        ''' Returns the item's information
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetItem() As IEnumerable(Of ItemInfoSchema.itemInfo_item)
            Return (From p In iiPage.itemInfo Where p.item.Count() > 0 Select p.item.First())
        End Function

        ''' <summary>
        ''' Returns the cost information of the item
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetCost() As ItemInfoSchema.cost
            Dim varCost = (From i In GetItem() Where i.cost.Count() > 0 Select i.cost.First())
            If varCost.Count = 0 Then
                Return Nothing
            Else
                Return varCost.First()
            End If
        End Function

        ''' <summary>
        ''' Returns the random properties of the item
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetRandomProperties() As ItemInfoSchema.randomProperties
            Dim varRandomProperties = (From i In GetItem() Where i.randomProperties.Count() > 0 Select i.randomProperties.First())
            If varRandomProperties.Count = 0 Then
                Return Nothing
            Else
                Return varRandomProperties.First()
            End If
        End Function

        ''' <summary>
        ''' Returns the disenchant loot of the item
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetDisenchantLoot() As ItemInfoSchema.disenchantLoot
            Dim varDisenchantLoot = (From i In GetItem() Where i.disenchantLoot.Count() > 0 Select i.disenchantLoot.First())
            If varDisenchantLoot.Count = 0 Then
                Return Nothing
            Else
                Return varDisenchantLoot.First()
            End If
        End Function

        ''' <summary>
        ''' Returns the quest that the item starts
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetStartsQuest() As ItemInfoSchema.startsQuest
            Dim varStartsQuest = (From i In GetItem() Where i.startsQuest.Count() > 0 Select i.startsQuest.First())
            If varStartsQuest.Count = 0 Then
                Return Nothing
            Else
                Return varStartsQuest.First()
            End If
        End Function

        ''' <summary>
        ''' Returns the quests that the item is provided for
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetProvidedForQuests() As ItemInfoSchema.providedForQuests
            Dim varProvidedForQuests = (From i In GetItem() Where i.providedForQuests.Count() > 0 Select i.providedForQuests.First())
            If varProvidedForQuests.Count = 0 Then
                Return Nothing
            Else
                Return varProvidedForQuests.First()
            End If
        End Function

        ''' <summary>
        ''' Returns the quests that the item is an objective of
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetObjectiveOfQuests() As ItemInfoSchema.objectiveOfQuests
            Dim varObjectiveOfQuests = (From i In GetItem() Where i.objectiveOfQuests.Count() > 0 Select i.objectiveOfQuests.First())
            If varObjectiveOfQuests.Count = 0 Then
                Return Nothing
            Else
                Return varObjectiveOfQuests.First()
            End If
        End Function

        ''' <summary>
        ''' Returns the quests that the item is a reward of
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetRewardFromQuests() As ItemInfoSchema.rewardFromQuests
            Dim varRewardFromQuests = (From i In GetItem() Where i.rewardFromQuests.Count() > 0 Select i.rewardFromQuests.First())
            If varRewardFromQuests.Count = 0 Then
                Return Nothing
            Else
                Return varRewardFromQuests.First()
            End If
        End Function

        ''' <summary>
        ''' Returns the vendors the item can be bought from
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetVendors() As ItemInfoSchema.vendors
            Dim varVendors = (From i In GetItem() Where i.vendors.Count() > 0 Select i.vendors.First())
            If varVendors.Count = 0 Then
                Return Nothing
            Else
                Return varVendors.First()
            End If
        End Function

        ''' <summary>
        ''' Returns the container objects the item can be found in
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetContainerObjects() As ItemInfoSchema.containerObjects
            Dim varContainerObjects = (From i In GetItem() Where i.containerObjects.Count() > 0 Select i.containerObjects.First())
            If varContainerObjects Is Nothing OrElse varContainerObjects.Count = 0 Then
                Return Nothing
            Else
                Return varContainerObjects.First()
            End If
        End Function

        ''' <summary>
        ''' Returns the creatures that the item can drop from
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetDropCreatures() As ItemInfoSchema.dropCreatures
            Dim varDropCreatures = (From i In GetItem() Where i.dropCreatures.Count() > 0 Select i.dropCreatures.First())
            If varDropCreatures.Count = 0 Then
                Return Nothing
            Else
                Return varDropCreatures.First()
            End If
        End Function

        ''' <summary>
        ''' Returns the creatures that the item can be pick pocketed from
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetPickPocketCreatures() As ItemInfoSchema.pickPocketCreatures
            Dim varPickPocketCreatures = (From i In GetItem() Where i.pickPocketCreatures.Count() > 0 Select i.pickPocketCreatures.First())
            If varPickPocketCreatures.Count = 0 Then
                Return Nothing
            Else
                Return varPickPocketCreatures.First()
            End If
        End Function

        ''' <summary>
        ''' Returns the creatures that the item can skinned from, via skinning or engineering
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetSkinCreatures() As ItemInfoSchema.skinCreatures
            Dim varSkinCreatures = (From i In GetItem() Where i.skinCreatures.Count() > 0 Select i.skinCreatures.First())
            If varSkinCreatures.Count = 0 Then
                Return Nothing
            Else
                Return varSkinCreatures.First()
            End If
        End Function

        ''' <summary>
        ''' Returns the creatures that the item can herbed from
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetHerbCreatures() As ItemInfoSchema.herbCreatures
            Dim varHerbCreatures = (From i In GetItem() Where i.herbCreatures.Count() > 0 Select i.herbCreatures.First())
            If varHerbCreatures.Count = 0 Then
                Return Nothing
            Else
                Return varHerbCreatures.First()
            End If
        End Function

        ''' <summary>
        ''' Returns the creatures that the item can mined from
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetMineCreatures() As ItemInfoSchema.mineCreatures
            Dim varMineCreatures = (From i In GetItem() Where i.mineCreatures.Count() > 0 Select i.mineCreatures.First())
            If varMineCreatures.Count = 0 Then
                Return Nothing
            Else
                Return varMineCreatures.First()
            End If
        End Function

        ''' <summary>
        ''' Returns the spell that creates the item
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetCreatedBy() As ItemInfoSchema.createdBy
            Dim varCreatedBy = (From i In GetItem() Where i.createdBy.Count() > 0 Select i.createdBy.First())
            If varCreatedBy.Count = 0 Then
                Return Nothing
            Else
                Return varCreatedBy.First()
            End If
        End Function

        ''' <summary>
        ''' Returns the spells that the reagent creates
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetReagentFor() As ItemInfoSchema.reagentFor
            Dim varReagentFor = (From i In GetItem() Where i.reagentFor.Count() > 0 Select i.reagentFor.First())
            If varReagentFor.Count = 0 Then
                Return Nothing
            Else
                Return varReagentFor.First()
            End If
        End Function

        ''' <summary>
        ''' Returns the items that can be bought with this item
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetCurrencyFor() As ItemInfoSchema.currencyFor
            Dim varCurrencyFor = (From i In GetItem() Where i.currencyFor.Count() > 0 Select i.currencyFor.First())
            If varCurrencyFor.Count = 0 Then
                Return Nothing
            Else
                Return varCurrencyFor.First()
            End If
        End Function

        ''' <summary>
        ''' Gets the list of tokens for a cost object
        ''' </summary>
        ''' <param name="cCost"></param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetTokens(ByVal cCost As ItemInfoSchema.cost) As List(Of ItemCost.TokenCost)
            If cCost.token Is Nothing Then
                Return New List(Of ItemCost.TokenCost)
            Else
                Return (From t In cCost.token Select New ItemCost.TokenCost(t.count, t.icon, t.id)).ToList()
            End If
        End Function

        ''' <summary>
        ''' Gets the list of random property enchantments for a random property
        ''' </summary>
        ''' <param name="rpProperty"></param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetRandomPropertyEnchants(ByVal rpProperty As ItemInfoSchema.randomProperty) As List(Of String)
            If rpProperty.randomPropertyEnchant Is Nothing Then
                Return New List(Of String)
            Else
                Return (From e In rpProperty.randomPropertyEnchant Select e.name).ToList()
            End If
        End Function

        ''' <summary>
        ''' Gets the list of areas for creature info
        ''' </summary>
        ''' <param name="iInfo"></param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetAreaInfo(ByVal iInfo As ItemInfoSchema.info) As List(Of CreatureInfo.AreaInfo)
            If iInfo.area Is Nothing Then
                Return New List(Of CreatureInfo.AreaInfo)
            Else
                Return (From a In iInfo.area Select New CreatureInfo.AreaInfo(a.id, a.name)).ToList()
            End If
        End Function

        ''' <summary>
        ''' Gets the list of creature types for creature info
        ''' </summary>
        ''' <param name="iinfo"></param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetCreatureTypes(ByVal iinfo As ItemInfoSchema.info) As List(Of CreatureInfo.CreatureType)
            If iinfo.type Is Nothing Then
                Return New List(Of CreatureInfo.CreatureType)
            Else
                Return (From t In iinfo.type Select New CreatureInfo.CreatureType(t.id, t.name)).ToList()
            End If
        End Function

        ''' <summary>
        ''' Gets the list of spell reagents for a spell
        ''' </summary>
        ''' <param name="cbsSpell"></param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetCreatedBySpellReagents(ByVal cbsSpell As ItemInfoSchema.createdBy_spell) As List(Of Reagent)
            If cbsSpell.reagent Is Nothing Then
                Return New List(Of Reagent)
            Else
                Return (From r In cbsSpell.reagent Select New Reagent(r.count, r.icon, r.id, r.name)).ToList()
            End If
        End Function

        ''' <summary>
        ''' Gets the list of spell reagents for a spell
        ''' </summary>
        ''' <param name="rfsSpell"></param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetReagentForSpellReagents(ByVal rfsSpell As ItemInfoSchema.reagentFor_spell) As List(Of Reagent)
            If rfsSpell.reagent Is Nothing Then
                Return New List(Of Reagent)
            Else
                Return (From r In rfsSpell.reagent Select New Reagent(r.count, r.icon, r.id, r.name)).ToList()
            End If
        End Function

        ''' <summary>
        ''' Gets the list of items for a spell
        ''' </summary>
        ''' <param name="rfsSpell"></param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetSpellItem(ByVal rfsSpell As ItemInfoSchema.reagentFor_spell) As SpellItem.SpellItem
            If rfsSpell.item Is Nothing Then
                Return Nothing
            Else
                Return (From i In rfsSpell.item Select New SpellItem.SpellItem(i.icon, i.id, i.level, i.name, i.quality, i.requiredAbility, i.requiredSkill, i.requiredSkillRank, i.type)).First()
            End If
        End Function

        ''' <summary>
        ''' Gets the list of costs for an item
        ''' </summary>
        ''' <param name="cfiItem"></param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetCurrencyItemCost(ByVal cfiItem As ItemInfoSchema.currencyFor_item) As ItemCost
            If cfiItem.cost Is Nothing Then
                Return Nothing
            Else
                Return (From c In cfiItem.cost Select New ItemCost(GetTokens(c), c.arena, c.buyPrice, c.factionId, c.honor, c.sellPrice)).First()
            End If
        End Function

        ''' <summary>
        ''' Gets the faction items translation information
        ''' </summary>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Private Function GetTranslationFor() As ItemInfoSchema.translationFor
            If GetItem().First().translationFor.Count = 0 Then
                Return Nothing
            Else
                Return GetItem().First().translationFor.First()
            End If
        End Function

#End Region

#Region "Nested Classes"

        ''' <summary>
        ''' A class that encapsulates item cost information
        ''' </summary>
        ''' <remarks></remarks>
        Public Class ItemCost
            Private tToken As List(Of TokenCost)
            Private intArena As Integer
            Private intBuyPrice As Integer
            Private intFactionID As Integer
            Private intHonor As Integer
            Private intSellPrice As Integer

            ''' <summary>
            ''' The token costs of the item
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Token() As List(Of TokenCost)
                Get
                    Return tToken
                End Get
                Set(ByVal value As List(Of TokenCost))
                    tToken = value
                End Set
            End Property

            ''' <summary>
            ''' The cost of the item in arena points
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Arena() As Integer
                Get
                    Return intArena
                End Get
                Set(ByVal value As Integer)
                    intArena = value
                End Set
            End Property

            ''' <summary>
            ''' The buy price of the item, in copper
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property BuyPrice() As Integer
                Get
                    Return intBuyPrice
                End Get
                Set(ByVal value As Integer)
                    intBuyPrice = value
                End Set
            End Property

            ''' <summary>
            ''' The faction that can purchase the item
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Faction() As FactionType
                Get
                    Return CType(intFactionID, FactionType)
                End Get
                Set(ByVal value As FactionType)
                    intFactionID = CInt(value)
                End Set
            End Property

            ''' <summary>
            ''' The cost of the item in honor points
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Honor() As Integer
                Get
                    Return intHonor
                End Get
                Set(ByVal value As Integer)
                    intHonor = value
                End Set
            End Property

            ''' <summary>
            ''' The sell price of the item, in copper
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property SellPrice() As Integer
                Get
                    Return intSellPrice
                End Get
                Set(ByVal value As Integer)
                    intSellPrice = value
                End Set
            End Property

            ''' <summary>
            ''' A constructor to create new item cost information
            ''' </summary>
            ''' <param name="tToken"></param>
            ''' <param name="intArena"></param>
            ''' <param name="intBuyPrice"></param>
            ''' <param name="intFactionID"></param>
            ''' <param name="intHonor"></param>
            ''' <param name="intSellPrice"></param>
            ''' <remarks></remarks>
            Public Sub New(ByVal tToken As List(Of TokenCost), ByVal intArena As Integer, ByVal intBuyPrice As Integer, ByVal intFactionID As Integer, ByVal intHonor As Integer, ByVal intSellPrice As Integer)
                Me.tToken = tToken
                Me.intArena = intArena
                Me.intBuyPrice = intBuyPrice
                Me.intFactionID = intFactionID
                Me.intHonor = intHonor
                Me.intSellPrice = intSellPrice
            End Sub

            ''' <summary>
            ''' A class that encapsulates a cost token
            ''' </summary>
            ''' <remarks></remarks>
            Public Class TokenCost
                Private intCount As Integer
                Private strIcon As String
                Private intID As Integer
                Private iiItem As ItemInfo

                ''' <summary>
                ''' The number of tokens required to buy the item
                ''' </summary>
                ''' <value></value>
                ''' <returns></returns>
                ''' <remarks></remarks>
                Public Property Count() As Integer
                    Get
                        Return intCount
                    End Get
                    Set(ByVal value As Integer)
                        intCount = value
                    End Set
                End Property

                ''' <summary>
                ''' The filename of the token's icon
                ''' </summary>
                ''' <value></value>
                ''' <returns></returns>
                ''' <remarks></remarks>
                Public Property Icon() As String
                    Get
                        Return strIcon
                    End Get
                    Set(ByVal value As String)
                        strIcon = value
                    End Set
                End Property

                ''' <summary>
                ''' The item ID of the token
                ''' </summary>
                ''' <value></value>
                ''' <returns></returns>
                ''' <remarks></remarks>
                Public Property ItemID() As Integer
                    Get
                        Return intID
                    End Get
                    Set(ByVal value As Integer)
                        intID = value
                    End Set
                End Property

                ''' <summary>
                ''' The item that represents the token
                ''' </summary>
                ''' <value></value>
                ''' <returns></returns>
                ''' <remarks></remarks>
                Public Property Item() As ItemInfo
                    Get
                        Return iiItem
                    End Get
                    Set(ByVal value As ItemInfo)
                        iiItem = value
                    End Set
                End Property

                ''' <summary>
                ''' A constructor to create the token
                ''' </summary>
                ''' <param name="intCount"></param>
                ''' <param name="strIcon"></param>
                ''' <param name="intID"></param>
                ''' <remarks></remarks>
                Friend Sub New(ByVal intCount As Integer, ByVal strIcon As String, ByVal intID As Integer)
                    Me.intCount = intCount
                    Me.strIcon = strIcon
                    Me.intID = intID
                    iiItem = New ItemInfo(intID)
                End Sub
            End Class
        End Class

        ''' <summary>
        ''' A class that encapsulates a random property
        ''' </summary>
        ''' <remarks></remarks>
        Public Class RandomProperty
            Private strSuffix As String
            Private scEnchantments As List(Of String)

            ''' <summary>
            ''' The random enchantment's suffix
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Suffix() As String
                Get
                    Return strSuffix
                End Get
                Set(ByVal value As String)
                    strSuffix = value
                End Set
            End Property

            ''' <summary>
            ''' An effect of the random enchantment
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Enchantments() As List(Of String)
                Get
                    Return scEnchantments
                End Get
                Set(ByVal value As List(Of String))
                    scEnchantments = value
                End Set
            End Property

            ''' <summary>
            ''' A constructor to create a new random property
            ''' </summary>
            ''' <param name="strSuffix"></param>
            ''' <param name="scEnchantments"></param>
            ''' <remarks></remarks>
            Friend Sub New(ByVal strSuffix As String, ByVal scEnchantments As List(Of String))
                Me.strSuffix = strSuffix
                Me.scEnchantments = scEnchantments
            End Sub
        End Class

        ''' <summary>
        ''' A class that encapsulates a disenchanted item
        ''' </summary>
        ''' <remarks></remarks>
        Public Class DisenchantItem
            Private intDropRate As Integer
            Private strIcon As String
            Private intID As Integer
            Private intLevel As Integer
            Private intMaxCount As Integer
            Private intMinCount As Integer
            Private strName As String
            Private intQuality As Integer
            Private strType As String
            Private iiItem As ItemInfo

            ''' <summary>
            ''' The approximate drop rate of the disenchanted material
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property DropRate() As DropRateType
                Get
                    Return CType(intDropRate, DropRateType)
                End Get
                Set(ByVal value As DropRateType)
                    intDropRate = CInt(value)
                End Set
            End Property

            ''' <summary>
            ''' The filename of the disenchanted material's icon
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Icon() As String
                Get
                    Return strIcon
                End Get
                Set(ByVal value As String)
                    strIcon = value
                End Set
            End Property

            ''' <summary>
            ''' The item ID of the disenchanted material
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property ItemID() As Integer
                Get
                    Return intID
                End Get
                Set(ByVal value As Integer)
                    intID = value
                End Set
            End Property

            ''' <summary>
            ''' The item level of the disenchanted material
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Level() As Integer
                Get
                    Return intLevel
                End Get
                Set(ByVal value As Integer)
                    intLevel = value
                End Set
            End Property

            ''' <summary>
            ''' The maximum quantity of material the item can be disenchanted into
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property MaxCount() As Integer
                Get
                    Return intMaxCount
                End Get
                Set(ByVal value As Integer)
                    intMaxCount = value
                End Set
            End Property

            ''' <summary>
            ''' The minimum quantity of material the item can be disenchanted into
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property MinCount() As Integer
                Get
                    Return intMinCount
                End Get
                Set(ByVal value As Integer)
                    intMinCount = value
                End Set
            End Property

            ''' <summary>
            ''' The name of the disenchanted material
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Name() As String
                Get
                    Return strName
                End Get
                Set(ByVal value As String)
                    strName = value
                End Set
            End Property

            ''' <summary>
            ''' The quality of the disenchanted material
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Quality() As RarityType
                Get
                    Return CType(intQuality, RarityType)
                End Get
                Set(ByVal value As RarityType)
                    intQuality = CInt(value)
                End Set
            End Property

            ''' <summary>
            ''' The type of the disenchanted material
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Type() As String
                Get
                    Return strType
                End Get
                Set(ByVal value As String)
                    strType = value
                End Set
            End Property

            ''' <summary>
            ''' The material the item can be disenchanted into
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Item() As ItemInfo
                Get
                    Return iiItem
                End Get
                Set(ByVal value As ItemInfo)
                    iiItem = value
                End Set
            End Property

            ''' <summary>
            ''' A constructor to create the disenchant item
            ''' </summary>
            ''' <param name="intDropRate"></param>
            ''' <param name="strIcon"></param>
            ''' <param name="intID"></param>
            ''' <param name="intLevel"></param>
            ''' <param name="intMaxCount"></param>
            ''' <param name="intMinCount"></param>
            ''' <param name="strName"></param>
            ''' <param name="intQuality"></param>
            ''' <param name="strType"></param>
            ''' <remarks></remarks>
            Friend Sub New(ByVal intDropRate As Integer, ByVal strIcon As String, ByVal intID As Integer, ByVal intLevel As Integer, ByVal intMaxCount As Integer, ByVal intMinCount As Integer, ByVal strName As String, ByVal intQuality As Integer, ByVal strType As String)
                Me.intDropRate = intDropRate
                Me.strIcon = strIcon
                Me.intID = intID
                Me.intLevel = intLevel
                Me.intMaxCount = intMaxCount
                Me.intMinCount = intMinCount
                Me.strName = strName
                Me.intQuality = intQuality
                Me.strType = strType
                iiItem = New ItemInfo(intID)
            End Sub

        End Class

        ''' <summary>
        ''' A class that encapsulates a quest
        ''' </summary>
        ''' <remarks></remarks>
        Public Class Quest
            Private strArea As String
            Private intID As Integer
            Private intLevel As Integer
            Private strName As String
            Private intReqMinLevel As Integer
            Private intSuggestedPartySize As Integer
            Private strType As String

            ''' <summary>
            ''' The area the quest is for
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Area() As String
                Get
                    Return strArea
                End Get
                Set(ByVal value As String)
                    strArea = value
                End Set
            End Property

            ''' <summary>
            ''' The ID number of the quest
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property QuestID() As Integer
                Get
                    Return intID
                End Get
                Set(ByVal value As Integer)
                    intID = value
                End Set
            End Property

            ''' <summary>
            ''' The level of the quest
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Level() As Integer
                Get
                    Return intLevel
                End Get
                Set(ByVal value As Integer)
                    intLevel = value
                End Set
            End Property

            ''' <summary>
            ''' The name of the quest
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Name() As String
                Get
                    Return strName
                End Get
                Set(ByVal value As String)
                    strName = value
                End Set
            End Property

            ''' <summary>
            ''' The required minimum level for the quest
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property ReqMinLevel() As Integer
                Get
                    Return intReqMinLevel
                End Get
                Set(ByVal value As Integer)
                    intReqMinLevel = value
                End Set
            End Property

            ''' <summary>
            ''' The suggested party size for the quest
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property SuggestedPartySize() As Integer
                Get
                    Return intSuggestedPartySize
                End Get
                Set(ByVal value As Integer)
                    intSuggestedPartySize = value
                End Set
            End Property

            ''' <summary>
            ''' The type of quest
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Type() As String
                Get
                    Return strType
                End Get
                Set(ByVal value As String)
                    strType = value
                End Set
            End Property

            ''' <summary>
            ''' A constructor to create the quest
            ''' </summary>
            ''' <param name="strArea"></param>
            ''' <param name="intID"></param>
            ''' <param name="intLevel"></param>
            ''' <param name="strName"></param>
            ''' <param name="intReqMinLevel"></param>
            ''' <param name="intSuggestedPartySize"></param>
            ''' <param name="strType"></param>
            ''' <remarks></remarks>
            Public Sub New(ByVal strArea As String, ByVal intID As Integer, ByVal intLevel As Integer, ByVal strName As String, ByVal intReqMinLevel As Integer, ByVal intSuggestedPartySize As Integer, ByVal strType As String)
                Me.strArea = strArea
                Me.intID = intID
                Me.intLevel = intLevel
                Me.strName = strName
                Me.intReqMinLevel = intReqMinLevel
                Me.intSuggestedPartySize = intSuggestedPartySize
                Me.strType = strType
            End Sub
        End Class

        ''' <summary>
        ''' A class that encapsulates a creature
        ''' </summary>
        ''' <remarks></remarks>
        Public Class Creature
            Private strArea As String
            Private strAreaURL As String
            Private intClassification As Integer
            Private intDropRate As Integer
            Private intHeroic As Integer
            Private intID As Integer
            Private intMaxLevel As Integer
            Private intMinLevel As Integer
            Private strName As String
            Private strTitle As String
            Private strType As String
            Private strURL As String

            ''' <summary>
            ''' The area the creature is in
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Area() As String
                Get
                    Return strArea
                End Get
                Set(ByVal value As String)
                    strArea = value
                End Set
            End Property

            ''' <summary>
            ''' The Armory URL of the area the creature is in
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property AreaURL() As String
                Get
                    Return strAreaURL
                End Get
                Set(ByVal value As String)
                    strAreaURL = value
                End Set
            End Property

            ''' <summary>
            ''' The classification of the creature
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Classification() As ClassificationType
                Get
                    Return CType(intClassification, ClassificationType)
                End Get
                Set(ByVal value As ClassificationType)
                    intClassification = CInt(value)
                End Set
            End Property

            ''' <summary>
            ''' The drop rate of the item from the creature
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property DropRate() As DropRateType
                Get
                    Return CType(intDropRate, DropRateType)
                End Get
                Set(ByVal value As DropRateType)
                    intDropRate = CInt(value)
                End Set
            End Property

            ''' <summary>
            ''' Whether or not the item is from the creature on heroic mode
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Heroic() As Boolean
                Get
                    Return intHeroic = 1
                End Get
                Set(ByVal value As Boolean)
                    intHeroic = If(value, 1, 0)
                End Set
            End Property

            ''' <summary>
            ''' The ID of the creature
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property CreatureID() As Integer
                Get
                    Return intID
                End Get
                Set(ByVal value As Integer)
                    intID = value
                End Set
            End Property

            ''' <summary>
            ''' The maximum possible level of the creature
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property MaxLevel() As Integer
                Get
                    Return intMaxLevel
                End Get
                Set(ByVal value As Integer)
                    intMaxLevel = value
                End Set
            End Property

            ''' <summary>
            ''' The minimum possible level of the creature
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property MinLevel() As Integer
                Get
                    Return intMinLevel
                End Get
                Set(ByVal value As Integer)
                    intMinLevel = value
                End Set
            End Property

            ''' <summary>
            ''' The name of the creature
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Name() As String
                Get
                    Return strName
                End Get
                Set(ByVal value As String)
                    strName = value
                End Set
            End Property

            ''' <summary>
            ''' The title of the creature
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Title() As String
                Get
                    Return strTitle
                End Get
                Set(ByVal value As String)
                    strTitle = value
                End Set
            End Property

            ''' <summary>
            ''' The type of creature
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Type() As String
                Get
                    Return strType
                End Get
                Set(ByVal value As String)
                    strType = value
                End Set
            End Property

            ''' <summary>
            ''' The Armory URL to the creature
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property URL() As String
                Get
                    Return strURL
                End Get
                Set(ByVal value As String)
                    strURL = value
                End Set
            End Property

            ''' <summary>
            ''' A constructor to create the creature
            ''' </summary>
            ''' <param name="strArea"></param>
            ''' <param name="strAreaURL"></param>
            ''' <param name="intClassification"></param>
            ''' <param name="intDropRate"></param>
            ''' <param name="intHeroic"></param>
            ''' <param name="intID"></param>
            ''' <param name="intMaxLevel"></param>
            ''' <param name="intMinLevel"></param>
            ''' <param name="strName"></param>
            ''' <param name="strTitle"></param>
            ''' <param name="strType"></param>
            ''' <param name="strURL"></param>
            ''' <remarks></remarks>
            Public Sub New(ByVal strArea As String, ByVal strAreaURL As String, ByVal intClassification As Integer, ByVal intDropRate As Integer, ByVal intHeroic As Integer, ByVal intID As Integer, ByVal intMaxLevel As Integer, ByVal intMinLevel As Integer, ByVal strName As String, ByVal strTitle As String, ByVal strType As String, ByVal strURL As String)
                Me.strArea = strArea
                Me.strAreaURL = strAreaURL
                Me.intClassification = intClassification
                Me.intDropRate = intDropRate
                Me.intHeroic = intHeroic
                Me.intID = intID
                Me.intMaxLevel = intMaxLevel
                Me.intMinLevel = intMinLevel
                Me.strName = strName
                Me.strTitle = strTitle
                Me.strType = strType
                Me.strURL = strURL
            End Sub
        End Class

        ''' <summary>
        ''' A class that encapsulates an object
        ''' </summary>
        ''' <remarks></remarks>
        Public Class [Object]
            Private strArea As String
            Private strAreaURL As String
            Private intDropRate As Integer
            Private intHeroic As Integer
            Private intID As Integer
            Private strName As String
            Private strURL As String

            ''' <summary>
            ''' The area the object is in
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Area() As String
                Get
                    Return strArea
                End Get
                Set(ByVal value As String)
                    strArea = value
                End Set
            End Property

            ''' <summary>
            ''' The Armory URL of the area the object is in
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property AreaURL() As String
                Get
                    Return strAreaURL
                End Get
                Set(ByVal value As String)
                    strAreaURL = value
                End Set
            End Property

            ''' <summary>
            ''' The drop rate of the item from the object
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property DropRate() As DropRateType
                Get
                    Return CType(intDropRate, DropRateType)
                End Get
                Set(ByVal value As DropRateType)
                    intDropRate = CInt(value)
                End Set
            End Property

            ''' <summary>
            ''' Whether or not the item is from the object on heroic mode
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Heroic() As Boolean
                Get
                    Return intHeroic = 1
                End Get
                Set(ByVal value As Boolean)
                    intHeroic = If(value, 1, 0)
                End Set
            End Property

            ''' <summary>
            ''' The ID of the object
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property OjbectID() As Integer
                Get
                    Return intID
                End Get
                Set(ByVal value As Integer)
                    intID = value
                End Set
            End Property

            ''' <summary>
            ''' The name of the object
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Name() As String
                Get
                    Return strName
                End Get
                Set(ByVal value As String)
                    strName = value
                End Set
            End Property

            ''' <summary>
            ''' The Armory URL to the object
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property URL() As String
                Get
                    Return strURL
                End Get
                Set(ByVal value As String)
                    strURL = value
                End Set
            End Property

            ''' <summary>
            ''' A constructor to create the object
            ''' </summary>
            ''' <param name="strArea"></param>
            ''' <param name="strAreaURL"></param>
            ''' <param name="intDropRate"></param>
            ''' <param name="intHeroic"></param>
            ''' <param name="intID"></param>
            ''' <param name="strName"></param>
            ''' <param name="strURL"></param>
            ''' <remarks></remarks>
            Public Sub New(ByVal strArea As String, ByVal strAreaURL As String, ByVal intDropRate As Integer, ByVal intHeroic As Integer, ByVal intID As Integer, ByVal strName As String, ByVal strURL As String)
                Me.strArea = strArea
                Me.strAreaURL = strAreaURL
                Me.intDropRate = intDropRate
                Me.intHeroic = intHeroic
                Me.intID = intID
                Me.strName = strName
                Me.strURL = strURL
            End Sub

        End Class

        ''' <summary>
        ''' A class that encapsulates detailed creature drop information
        ''' </summary>
        ''' <remarks></remarks>
        Public Class CreatureInfo
            Private lstArea As New List(Of AreaInfo)
            Private lstType As New List(Of CreatureType)
            Private dblAvgMaxLevel As Double
            Private dblAvgMinLevel As Double
            Private intMaxLevel As Integer
            Private intMinLevel As Integer

            ''' <summary>
            ''' The area of the creatures the item comes from
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Area() As List(Of AreaInfo)
                Get
                    Return lstArea
                End Get
                Set(ByVal value As List(Of AreaInfo))
                    lstArea = value
                End Set
            End Property

            ''' <summary>
            ''' The type of creatures the item comes from
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Type() As List(Of CreatureType)
                Get
                    Return lstType
                End Get
                Set(ByVal value As List(Of CreatureType))
                    lstType = value
                End Set
            End Property

            ''' <summary>
            ''' The average of the maximum level of creatures the item comes from
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property AvgMaxLevel() As Double
                Get
                    Return dblAvgMaxLevel
                End Get
                Set(ByVal value As Double)
                    dblAvgMaxLevel = value
                End Set
            End Property

            ''' <summary>
            ''' The average of the minimum level of creatures the item comes from
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property AvgMinLevel() As Double
                Get
                    Return dblAvgMinLevel
                End Get
                Set(ByVal value As Double)
                    dblAvgMinLevel = value
                End Set
            End Property

            ''' <summary>
            ''' The maximum level of creatures the item comes from
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property MaxLevel() As Integer
                Get
                    Return intMaxLevel
                End Get
                Set(ByVal value As Integer)
                    intMaxLevel = value
                End Set
            End Property

            ''' <summary>
            ''' The minimum level of creatures the item comes from
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property MinLevel() As Integer
                Get
                    Return intMinLevel
                End Get
                Set(ByVal value As Integer)
                    intMinLevel = value
                End Set
            End Property

            ''' <summary>
            ''' A constructor to create new creature drop information
            ''' </summary>
            ''' <param name="lstArea"></param>
            ''' <param name="lstType"></param>
            ''' <param name="dblAvgMaxLevel"></param>
            ''' <param name="dblAvgMinLevel"></param>
            ''' <param name="intMaxLevel"></param>
            ''' <param name="intMinLevel"></param>
            ''' <remarks></remarks>
            Public Sub New(ByVal lstArea As List(Of AreaInfo), ByVal lstType As List(Of CreatureType), ByVal dblAvgMaxLevel As Double, ByVal dblAvgMinLevel As Double, ByVal intMaxLevel As Integer, ByVal intMinLevel As Integer)
                Me.lstArea = lstArea
                Me.lstType = lstType
                Me.dblAvgMaxLevel = dblAvgMaxLevel
                Me.dblAvgMinLevel = dblAvgMinLevel
                Me.intMaxLevel = intMaxLevel
                Me.intMinLevel = intMinLevel
            End Sub

            ''' <summary>
            ''' A class that encapsulates an area
            ''' </summary>
            ''' <remarks></remarks>
            Public Class AreaInfo
                Private intID As Integer
                Private strName As String

                ''' <summary>
                ''' The ID of the area
                ''' </summary>
                ''' <value></value>
                ''' <returns></returns>
                ''' <remarks></remarks>
                Public Property AreaID() As Integer
                    Get
                        Return intID
                    End Get
                    Set(ByVal value As Integer)
                        intID = value
                    End Set
                End Property

                ''' <summary>
                ''' The name of the area
                ''' </summary>
                ''' <value></value>
                ''' <returns></returns>
                ''' <remarks></remarks>
                Public Property Name() As String
                    Get
                        Return strName
                    End Get
                    Set(ByVal value As String)
                        strName = value
                    End Set
                End Property

                ''' <summary>
                ''' A constructor to create a new area
                ''' </summary>
                ''' <param name="intID"></param>
                ''' <param name="strName"></param>
                ''' <remarks></remarks>
                Public Sub New(ByVal intID As Integer, ByVal strName As String)
                    Me.intID = intID
                    Me.strName = strName
                End Sub
            End Class

            ''' <summary>
            ''' A class that encapsulates a creature type
            ''' </summary>
            ''' <remarks></remarks>
            Public Class CreatureType
                Private intID As Integer
                Private strName As String

                ''' <summary>
                ''' The ID of the creature type
                ''' </summary>
                ''' <value></value>
                ''' <returns></returns>
                ''' <remarks></remarks>
                Public Property CreatureTypeID() As Integer
                    Get
                        Return intID
                    End Get
                    Set(ByVal value As Integer)
                        intID = value
                    End Set
                End Property

                ''' <summary>
                ''' The name of the creature type
                ''' </summary>
                ''' <value></value>
                ''' <returns></returns>
                ''' <remarks></remarks>
                Public Property Name() As String
                    Get
                        Return strName
                    End Get
                    Set(ByVal value As String)
                        strName = value
                    End Set
                End Property

                ''' <summary>
                ''' A constructor to create a new creature type
                ''' </summary>
                ''' <param name="intID"></param>
                ''' <param name="strName"></param>
                ''' <remarks></remarks>
                Public Sub New(ByVal intID As Integer, ByVal strName As String)
                    Me.intID = intID
                    Me.strName = strName
                End Sub
            End Class

        End Class

        ''' <summary>
        ''' A class that encapsulates a reagent used by a spell
        ''' </summary>
        ''' <remarks></remarks>
        Public Class Reagent
            Private intCount As Integer
            Private strIcon As String
            Private intID As Integer
            Private strName As String
            Private iiItem As ItemInfo

            ''' <summary>
            ''' The number of the reagent required to cast the spell
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Count() As Integer
                Get
                    Return intCount
                End Get
                Set(ByVal value As Integer)
                    intCount = value
                End Set
            End Property

            ''' <summary>
            ''' The filename of the reagent's icon
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Icon() As String
                Get
                    Return strIcon
                End Get
                Set(ByVal value As String)
                    strIcon = value
                End Set
            End Property

            ''' <summary>
            ''' The item identification number of the reagent
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property ItemID() As Integer
                Get
                    Return intID
                End Get
                Set(ByVal value As Integer)
                    intID = value
                End Set
            End Property

            ''' <summary>
            ''' The name of the reagent
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Name() As String
                Get
                    Return strName
                End Get
                Set(ByVal value As String)
                    strName = value
                End Set
            End Property

            ''' <summary>
            ''' The item that is a reagent for the spell
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Item() As ItemInfo
                Get
                    Return iiItem
                End Get
                Set(ByVal value As ItemInfo)
                    iiItem = value
                End Set
            End Property

            ''' <summary>
            ''' A constructor to create a reagent item
            ''' </summary>
            ''' <param name="intCount"></param>
            ''' <param name="strIcon"></param>
            ''' <param name="intID"></param>
            ''' <param name="strName"></param>
            ''' <remarks></remarks>
            Public Sub New(ByVal intCount As Integer, ByVal strIcon As String, ByVal intID As Integer, ByVal strName As String)
                Me.intCount = intCount
                Me.strIcon = strIcon
                Me.intID = intID
                Me.strName = strName
                Me.iiItem = New ItemInfo(intID)
            End Sub
        End Class

        ''' <summary>
        ''' A class that encapsulates a spell that creates an item
        ''' </summary>
        ''' <remarks></remarks>
        Public Class SpellItem
            Private siItem As SpellItem
            Private lstReagents As List(Of Reagent)
            Private strIcon As String
            Private intID As Integer
            Private strName As String

            ''' <summary>
            ''' The item created by the spell
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Item() As SpellItem
                Get
                    Return siItem
                End Get
                Set(ByVal value As SpellItem)
                    siItem = value
                End Set
            End Property

            ''' <summary>
            ''' The reagents required to cast the spell
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Reagents() As List(Of Reagent)
                Get
                    Return lstReagents
                End Get
                Set(ByVal value As List(Of Reagent))
                    lstReagents = value
                End Set
            End Property

            ''' <summary>
            ''' The filename of the spell's icon
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Icon() As String
                Get
                    Return strIcon
                End Get
                Set(ByVal value As String)
                    strIcon = value
                End Set
            End Property

            ''' <summary>
            ''' The identification number of the spell
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property SpellID() As Integer
                Get
                    Return intID
                End Get
                Set(ByVal value As Integer)
                    intID = value
                End Set
            End Property

            ''' <summary>
            ''' The name of the spell
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Name() As String
                Get
                    Return strName
                End Get
                Set(ByVal value As String)
                    strName = value
                End Set
            End Property

            ''' <summary>
            ''' A constructor to create new spell information
            ''' </summary>
            ''' <param name="siItem"></param>
            ''' <param name="strIcon"></param>
            ''' <param name="intID"></param>
            ''' <param name="strName"></param>
            ''' <remarks></remarks>
            Public Sub New(ByVal siItem As SpellItem, ByVal lstReagents As List(Of Reagent), ByVal strIcon As String, ByVal intID As Integer, ByVal strName As String)
                Me.siItem = siItem
                Me.lstReagents = lstReagents
                Me.strIcon = strIcon
                Me.intID = intID
                Me.strName = strName
            End Sub

            ''' <summary>
            ''' A class that encapsulates an item created by a spell
            ''' </summary>
            ''' <remarks></remarks>
            Public Class SpellItem
                Private strIcon As String
                Private intID As Integer
                Private intLevel As Integer
                Private strName As String
                Private intQuality As Integer
                Private strRequiredAbility As String
                Private strRequiredSkill As String
                Private intRequiredSkillRank As Integer
                Private strType As String
                Private iiItem As ItemInfo

                ''' <summary>
                ''' The filename of the item's icon
                ''' </summary>
                ''' <value></value>
                ''' <returns></returns>
                ''' <remarks></remarks>
                Public Property Icon() As String
                    Get
                        Return strIcon
                    End Get
                    Set(ByVal value As String)
                        strIcon = value
                    End Set
                End Property

                ''' <summary>
                ''' The ID of the item
                ''' </summary>
                ''' <value></value>
                ''' <returns></returns>
                ''' <remarks></remarks>
                Public Property ItemID() As Integer
                    Get
                        Return intID
                    End Get
                    Set(ByVal value As Integer)
                        intID = value
                    End Set
                End Property

                ''' <summary>
                ''' The item level
                ''' </summary>
                ''' <value></value>
                ''' <returns></returns>
                ''' <remarks></remarks>
                Public Property Level() As Integer
                    Get
                        Return intLevel
                    End Get
                    Set(ByVal value As Integer)
                        intLevel = value
                    End Set
                End Property

                ''' <summary>
                ''' The name of the item
                ''' </summary>
                ''' <value></value>
                ''' <returns></returns>
                ''' <remarks></remarks>
                Public Property Name() As String
                    Get
                        Return strName
                    End Get
                    Set(ByVal value As String)
                        strName = value
                    End Set
                End Property

                ''' <summary>
                ''' The quality of the item
                ''' </summary>
                ''' <value></value>
                ''' <returns></returns>
                ''' <remarks></remarks>
                Public Property Quality() As RarityType
                    Get
                        Return CType(intQuality, RarityType)
                    End Get
                    Set(ByVal value As RarityType)
                        intQuality = CInt(value)
                    End Set
                End Property

                ''' <summary>
                ''' The required ability to use the item
                ''' </summary>
                ''' <value></value>
                ''' <returns></returns>
                ''' <remarks></remarks>
                Public Property RequiredAbility() As String
                    Get
                        Return strRequiredAbility
                    End Get
                    Set(ByVal value As String)
                        strRequiredAbility = value
                    End Set
                End Property

                ''' <summary>
                ''' The required profession to use the item
                ''' </summary>
                ''' <value></value>
                ''' <returns></returns>
                ''' <remarks></remarks>
                Public Property RequiredSkill() As String
                    Get
                        Return strRequiredSkill
                    End Get
                    Set(ByVal value As String)
                        strRequiredSkill = value
                    End Set
                End Property

                ''' <summary>
                ''' The required skill level to use the item
                ''' </summary>
                ''' <value></value>
                ''' <returns></returns>
                ''' <remarks></remarks>
                Public Property RequiredSkillRank() As Integer
                    Get
                        Return intRequiredSkillRank
                    End Get
                    Set(ByVal value As Integer)
                        intRequiredSkillRank = value
                    End Set
                End Property

                ''' <summary>
                ''' The type of the item created by the spell
                ''' </summary>
                ''' <value></value>
                ''' <returns></returns>
                ''' <remarks></remarks>
                Public Property Type() As String
                    Get
                        Return strType
                    End Get
                    Set(ByVal value As String)
                        strType = value
                    End Set
                End Property

                ''' <summary>
                ''' The item created by the spell
                ''' </summary>
                ''' <value></value>
                ''' <returns></returns>
                ''' <remarks></remarks>
                Public Property Item() As ItemInfo
                    Get
                        Return iiItem
                    End Get
                    Set(ByVal value As ItemInfo)
                        iiItem = value
                    End Set
                End Property

                ''' <summary>
                ''' A constructor to create new spell item information
                ''' </summary>
                ''' <param name="strIcon"></param>
                ''' <param name="intID"></param>
                ''' <param name="intLevel"></param>
                ''' <param name="strName"></param>
                ''' <param name="intQuality"></param>
                ''' <param name="strRequiredAbility"></param>
                ''' <param name="strRequiredSkill"></param>
                ''' <param name="intRequiredSkillRank"></param>
                ''' <param name="strType"></param>
                ''' <remarks></remarks>
                Public Sub New(ByVal strIcon As String, ByVal intID As Integer, ByVal intLevel As Integer, ByVal strName As String, ByVal intQuality As Integer, ByVal strRequiredAbility As String, ByVal strRequiredSkill As String, ByVal intRequiredSkillRank As Integer, ByVal strType As String)
                    Me.strIcon = strIcon
                    Me.intID = intID
                    Me.intLevel = intLevel
                    Me.strName = strName
                    Me.intQuality = intQuality
                    Me.strRequiredAbility = strRequiredAbility
                    Me.strRequiredSkill = strRequiredSkill
                    Me.intRequiredSkillRank = intRequiredSkillRank
                    Me.strType = strType
                    Me.iiItem = New ItemInfo(intID)
                End Sub
            End Class
        End Class

        ''' <summary>
        ''' A class that encapsulates a spell that creates an item
        ''' </summary>
        ''' <remarks></remarks>
        Public Class SpellReagents
            Private lstReagents As List(Of Reagent)
            Private strIcon As String
            Private intID As Integer
            Private strName As String

            ''' <summary>
            ''' The reagents required to cast the spell
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Reagents() As List(Of Reagent)
                Get
                    Return lstReagents
                End Get
                Set(ByVal value As List(Of Reagent))
                    lstReagents = value
                End Set
            End Property

            ''' <summary>
            ''' The filename of the spell's icon
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Icon() As String
                Get
                    Return strIcon
                End Get
                Set(ByVal value As String)
                    strIcon = value
                End Set
            End Property

            ''' <summary>
            ''' The identification number of the spell
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property SpellID() As Integer
                Get
                    Return intID
                End Get
                Set(ByVal value As Integer)
                    intID = value
                End Set
            End Property

            ''' <summary>
            ''' The name of the spell
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Name() As String
                Get
                    Return strName
                End Get
                Set(ByVal value As String)
                    strName = value
                End Set
            End Property

            ''' <summary>
            ''' A constructor to create new spell information
            ''' </summary>
            ''' <param name="lstReagents"></param>
            ''' <param name="strIcon"></param>
            ''' <param name="intID"></param>
            ''' <param name="strName"></param>
            ''' <remarks></remarks>
            Public Sub New(ByVal lstReagents As List(Of Reagent), ByVal strIcon As String, ByVal intID As Integer, ByVal strName As String)
                Me.lstReagents = lstReagents
                Me.strIcon = strIcon
                Me.intID = intID
                Me.strName = strName
            End Sub
        End Class

        ''' <summary>
        ''' A class that encapsulates an item bought with currency
        ''' </summary>
        ''' <remarks></remarks>
        Public Class CurrencyItem
            Private cCost As ItemCost
            Private strIcon As String
            Private intID As Integer
            Private intLevel As Integer
            Private strName As String
            Private intQuality As Integer
            Private strRequiredSkill As String
            Private intRequiredSkillRank As Integer
            Private strType As String
            Private iiItem As ItemInfo

            ''' <summary>
            ''' The cost of the item bought with the currency
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Cost() As ItemCost
                Get
                    Return cCost
                End Get
                Set(ByVal value As ItemCost)
                    cCost = value
                End Set
            End Property

            ''' <summary>
            ''' The filename of the icon of the item bought with the currency
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Icon() As String
                Get
                    Return strIcon
                End Get
                Set(ByVal value As String)
                    strIcon = value
                End Set
            End Property

            ''' <summary>
            ''' The identification number of the item bought with the currency
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property ID() As Integer
                Get
                    Return intID
                End Get
                Set(ByVal value As Integer)
                    intID = value
                End Set
            End Property

            ''' <summary>
            ''' The level of the item bought with the currency
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Level() As Integer
                Get
                    Return intLevel
                End Get
                Set(ByVal value As Integer)
                    intLevel = value
                End Set
            End Property

            ''' <summary>
            ''' The name of the item bought with the currency
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Name() As String
                Get
                    Return strName
                End Get
                Set(ByVal value As String)
                    strName = value
                End Set
            End Property

            ''' <summary>
            ''' The quality of the item bought with the currency
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Quality() As RarityType
                Get
                    Return CType(intQuality, RarityType)
                End Get
                Set(ByVal value As RarityType)
                    intQuality = CInt(value)
                End Set
            End Property

            ''' <summary>
            ''' The required profession to use the item bought with the currency
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property RequiredSkill() As String
                Get
                    Return strRequiredSkill
                End Get
                Set(ByVal value As String)
                    strRequiredSkill = value
                End Set
            End Property

            ''' <summary>
            ''' The required skill rank to use the item bought with the currency
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property RequiredSkillRank() As Integer
                Get
                    Return intRequiredSkillRank
                End Get
                Set(ByVal value As Integer)
                    intRequiredSkillRank = value
                End Set
            End Property

            ''' <summary>
            ''' The type of item that can be bought with the currency
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Type() As String
                Get
                    Return strType
                End Get
                Set(ByVal value As String)
                    strType = value
                End Set
            End Property

            ''' <summary>
            ''' The item that can be bought with the currency
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Item() As ItemInfo
                Get
                    Return iiItem
                End Get
                Set(ByVal value As ItemInfo)
                    iiItem = value
                End Set
            End Property

            ''' <summary>
            ''' A constructor to create a new item that's bought with currency
            ''' </summary>
            ''' <param name="cCost"></param>
            ''' <param name="strIcon"></param>
            ''' <param name="intID"></param>
            ''' <param name="intLevel"></param>
            ''' <param name="strName"></param>
            ''' <param name="intQuality"></param>
            ''' <param name="strRequiredSkill"></param>
            ''' <param name="intRequiredSkillRank"></param>
            ''' <param name="strType"></param>
            ''' <remarks></remarks>
            Public Sub New(ByVal cCost As ItemCost, ByVal strIcon As String, ByVal intID As Integer, ByVal intLevel As Integer, ByVal strName As String, ByVal intQuality As Integer, ByVal strRequiredSkill As String, ByVal intRequiredSkillRank As Integer, ByVal strType As String)
                Me.cCost = cCost
                Me.strIcon = strIcon
                Me.intID = intID
                Me.intLevel = intLevel
                Me.strName = strName
                Me.intQuality = intQuality
                Me.strRequiredSkill = strRequiredSkill
                Me.intRequiredSkillRank = intRequiredSkillRank
                Me.strType = strType
                Me.iiItem = New ItemInfo(intID)
            End Sub
        End Class

        ''' <summary>
        ''' A class that encapsulates faction item translation information
        ''' </summary>
        ''' <remarks></remarks>
        Public Class TranslationForItem

            Private fFaction As FactionType
            Private strIcon As String
            Private intID As Integer
            Private intLevel As Integer
            Private strName As String
            Private rRarity As RarityType

            ''' <summary>
            ''' The opposite faction
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Faction() As FactionType
                Get
                    Return fFaction
                End Get
                Set(ByVal value As FactionType)
                    fFaction = value
                End Set
            End Property

            ''' <summary>
            ''' The icon's filename of the opposite faction's item
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Icon() As String
                Get
                    Return strIcon
                End Get
                Set(ByVal value As String)
                    strIcon = value
                End Set
            End Property

            ''' <summary>
            ''' The identification number of the opposite faction's item
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property ID() As Integer
                Get
                    Return intID
                End Get
                Set(ByVal value As Integer)
                    intID = value
                End Set
            End Property

            ''' <summary>
            ''' The item level of the opposite faction's item
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Level() As Integer
                Get
                    Return intLevel
                End Get
                Set(ByVal value As Integer)
                    intLevel = value
                End Set
            End Property

            ''' <summary>
            ''' The name of the opposite faction's item
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Name() As String
                Get
                    Return strName
                End Get
                Set(ByVal value As String)
                    strName = value
                End Set
            End Property

            ''' <summary>
            ''' The rarity of the opposite faction's item
            ''' </summary>
            ''' <value></value>
            ''' <returns></returns>
            ''' <remarks></remarks>
            Public Property Rarity() As RarityType
                Get
                    Return rRarity
                End Get
                Set(ByVal value As RarityType)
                    rRarity = value
                End Set
            End Property

            ''' <summary>
            ''' A constructor to create new faction item translation information
            ''' </summary>
            ''' <param name="intFactionID"></param>
            ''' <param name="strIcon"></param>
            ''' <param name="intID"></param>
            ''' <param name="intLevel"></param>
            ''' <param name="strName"></param>
            ''' <param name="intQuality"></param>
            ''' <remarks></remarks>
            Public Sub New(ByVal intFactionID As Integer, ByVal strIcon As String, ByVal intID As Integer, ByVal intLevel As Integer, ByVal strName As String, ByVal intQuality As Integer)
                Me.fFaction = CType(intFactionID, FactionType)
                Me.strIcon = strIcon
                Me.intID = intID
                Me.intLevel = intLevel
                Me.strName = strName
                Me.rRarity = CType(intQuality, RarityType)
            End Sub

        End Class

#End Region

    End Class

End Namespace